﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SAFTCopyToDB
{
    [Table("Header")]
    public partial class Header
    {
        public int ID { get; set; }

        public string AuditFileVersion { get; set; }
        public string CompanyID { get; set; }
        public string TaxRegistrationNumber { get; set; }
        public string TaxAccountingBasis { get; set; }
        public string CompanyName { get; set; }
        public string BusinessName { get; set; }
        public string BuildingNumber { get; set; }
        public string StreetName { get; set; }
        public string AddressDetail { get; set; }
        public string City { get; set; }
        public string PostalCode { get; set; }
        public string Region { get; set; }
        public object Country { get; set; }
        public string FiscalYear { get; set; }
        public SqlDateTime StartDate { get; set; }
        public SqlDateTime EndDate { get; set; }
        public string CurrencyCode { get; set; }
        public SqlDateTime DateCreated { get; set; }
        public string TaxEntity { get; set; }
        public string ProductCompanyTaxID { get; set; }
        public string SoftwareCertificateNumber { get; set; }
        public string ProductID { get; set; }
        public string ProductVersion { get; set; }
        public string HeaderComment { get; set; }
        public string Telephone { get; set; }
        public string Fax { get; set; }
        public string Email { get; set; }
        public string Website { get; set; }
    }

    [Table("SupplierAddressStructure")]
    public partial class SupplierAddressStructure
    {
        public int ID { get; set; }

        public string BuildingNumber { get; set; }
        public string StreetName { get; set; }
        public string AddressDetail { get; set; }
        public string City { get; set; }
        public string PostalCode { get; set; }
        public string Region { get; set; }
        public string Country { get; set; }
    }

    [Table("Customer")]
    public partial class Customer
    {
        public int ID { get; set; }

        public string CustomerID { get; set; }
        public string AccountID { get; set; }
        public string CustomerTaxID { get; set; }
        public string CompanyName { get; set; }
        public string Contact { get; set; }
        public AddressStructure BillingAddress { get; set; }
        public AddressStructure ShipToAddress { get; set; }
        public string Telephone { get; set; }
        public string Fax { get; set; }
        public string Email { get; set; }
        public string Website { get; set; }
        public string SelfBillingIndicator { get; set; }
    }

    [Table("AddressStructure")]
    public partial class AddressStructure
    {
        public int ID { get; set; }

        public string BuildingNumber { get; set; }
        public string StreetName { get; set; }
        public string AddressDetail { get; set; }
        public string City { get; set; }
        public string PostalCode { get; set; }
        public string Region { get; set; }
        public string Country { get; set; }
    }

    [Table("Product")]
    public partial class Product
    {
        public int ID { get; set; }

        public string ProductType { get; set; }
        public string ProductCode { get; set; }
        public string ProductGroup { get; set; }
        public string ProductDescription { get; set; }
        public string ProductNumberCode { get; set; }
    }

    [Table("Supplier")]
    public partial class Supplier
    {
        public int ID { get; set; }

        public string SupplierID { get; set; }
        public string AccountID { get; set; }
        public string SupplierTaxID { get; set; }
        public string CompanyName { get; set; }
        public string Contact { get; set; }
        public SupplierAddressStructure BillingAddress { get; set; }
        public SupplierAddressStructure ShipFromAddress { get; set; }
        public string Telephone { get; set; }
        public string Fax { get; set; }
        public string Email { get; set; }
        public string Website { get; set; }
        public string SelfBillingIndicator { get; set; }
    }

    [Table("TaxTableEntry")]
    public partial class TaxTableEntry
    {
        public int ID { get; set; }

        public string TaxType { get; set; }
        public string TaxCountryRegion { get; set; }
        public string TaxCode { get; set; }
        public string Description { get; set; }
        public SqlDateTime TaxExpirationDate { get; set; }
        public bool TaxExpirationDateSpecified { get; set; }
        public decimal TaxAmount { get; set; }
        public decimal TaxPercentage { get; set; }
    }

    [Table("GeneralLedger")]
    public partial class GeneralLedger
    {
        public int ID { get; set; }

        public string AccountID { get; set; }
        public string AccountDescription { get; set; }
        public decimal OpeningDebitBalance { get; set; }
        public decimal OpeningCreditBalance { get; set; }
    }

    [Table("GeneralLedgerEntries")]
    public partial class GeneralLedgerEntries
    {
        public int ID { get; set; }

        public string NumberOfEntries { get; set; }
        public decimal TotalDebit { get; set; }
        public decimal TotalCredit { get; set; }
        public virtual IQueryable<GeneralLedgerEntriesJournal> Journal { get; set; }
    }

    [Table("GeneralLedgerEntriesJornal")]
    public partial class GeneralLedgerEntriesJournal
    {
        public int ID { get; set; }

        [ForeignKey("GeneralLedgerEntriesID")]
        public virtual GeneralLedgerEntries GeneralLedgerEntries { get; set; }
        public int GeneralLedgerEntriesID { get; set; }

        public string JournalID { get; set; }
        public string Description { get; set; }
        public GeneralLedgerEntriesJournalTransaction[] Transaction { get; set; }
    }

    [Table("GeneralLedgerEntriesJornalTransaction")]
    public partial class GeneralLedgerEntriesJournalTransaction
    {
        public int ID { get; set; }

        public string TransactionID { get; set; }
        public string Period { get; set; }
        public SqlDateTime TransactionDate { get; set; }
        public string SourceID { get; set; }
        public string Description { get; set; }
        public string DocArchivalNumber { get; set; }
        public string TransactionType { get; set; }
        public SqlDateTime GLPostingDate { get; set; }
        public string CustomerID { get; set; }
        public string SupplierID { get; set; }

        public virtual IQueryable<GeneralLedgerEntriesJournalTransactionLine> Line { get; set; }
    }

    [Table("GeneralLedgerEntriesJornalTransactionLine")]
    public partial class GeneralLedgerEntriesJournalTransactionLine
    {
        public int ID { get; set; }

        public string RecordID { get; set; }
        public string AccountID { get; set; }
        public string SourceDocumentID { get; set; }
        public SqlDateTime SystemEntryDate { get; set; }
        public string Description { get; set; }
        public decimal CreditAmount { get; set; }
        public decimal DebitAmount { get; set; }
    }

    [Table("SourceDocumentsSalesInvoices")]
    public partial class SourceDocumentsSalesInvoices
    {
        public int ID { get; set; }

        public string NumberOfEntries { get; set; }
        public decimal TotalDebit { get; set; }
        public decimal TotalCredit { get; set; }
    }

    [Table("SourceDocumentsSalesInvoicesInvoice")]
    public partial class SourceDocumentsSalesInvoicesInvoice
    {
        public int ID { get; set; }

        public string InvoiceNo { get; set; }
        public string InvoiceStatus { get; set; }
        public string Hash { get; set; }
        public string HashControl { get; set; }
        public string Period { get; set; }
        public SqlDateTime InvoiceDate { get; set; }
        public string InvoiceType { get; set; }
        public string SelfBillingIndicator { get; set; }
        public SqlDateTime SystemEntryDate { get; set; }
        public string TransactionID { get; set; }
        public string CustomerID { get; set; }
        public ShippingPointStructure ShipTo { get; set; }
        public ShippingPointStructure ShipFrom { get; set; }
        public decimal TaxPayable { get; set; }
        public decimal NetTotal { get; set; }
        public decimal GrossTotal { get; set; }
        public string CurrencyCode { get; set; }
        public decimal CurrencyCreditAmount { get; set; }
        public decimal CurrencyDebitAmount { get; set; }
        public string SettlementDiscount { get; set; }
        public decimal SettlementAmount { get; set; }
        public SqlDateTime SettlementDate { get; set; }
        public string PaymentMechanism { get; set; }

        public virtual IQueryable<SourceDocumentsSalesInvoicesInvoiceLine> Line { get; set; }
    }

    [Table("SourceDocumentsSalesInvoicesInvoiceLine")]
    public partial class SourceDocumentsSalesInvoicesInvoiceLine
    {
        public int ID { get; set; }

        [ForeignKey("InvoiceID")]
        public virtual SourceDocumentsSalesInvoicesInvoice Invoice { get; set; }
        public int InvoiceID { get; set; }

        public string LineNumber { get; set; }
        public string OriginatingON { get; set; }
        public SqlDateTime OrderDate { get; set; }
        public string ProductCode { get; set; }
        public string ProductDescription { get; set; }
        public decimal Quantity { get; set; }
        public string UnitOfMeasure { get; set; }
        public decimal UnitPrice { get; set; }
        public SqlDateTime TaxPointDate { get; set; }
        public string Reference { get; set; }
        public string ReferenceReason { get; set; }
        public string Description { get; set; }
        public decimal CreditAmount { get; set; }
        public decimal DebitAmount { get; set; }
        public Tax Tax { get; set; }
        public string TaxExemptionReason { get; set; }
        public decimal SettlementAmount { get; set; }
    }

    [Table("ShippingPointStructure")]
    public partial class ShippingPointStructure
    {
        public int ID { get; set; }

        [ForeignKey("InvoiceID")]
        public virtual SourceDocumentsSalesInvoicesInvoice Invoice { get; set; }
        public int InvoiceID { get; set; }

        public string DeliveryID { get; set; }
        public SqlDateTime DeliveryDate { get; set; }
        public bool DeliveryDateSpecified { get; set; }
        public AddressStructure Address { get; set; }
    }

    [Table("Tax")]
    public partial class Tax
    {
        public int ID { get; set; }

        public string TaxType { get; set; }
        public string TaxCountryRegion { get; set; }
        public string TaxCode { get; set; }
        public decimal TaxAmount { get; set; }
        public decimal TaxPercentage { get; set; }
    }
}
